export default class Queue {
  constructor() {
    this.list = []
  }
  add(some) {
    this.list.push(some)
    this.next()
  }
  next() {
    let some = this.list.pop()
    if (some) {
      some(next)
    }
  }
}

class Some {
  constructor(next) {
    this.next = next
  }
  complete() {
    //其他内容
    //如果有队列next则调用
    this.next && this.next()
  }
}
